using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class CustomDataType
    {

        private GTame.ReportParser.DataColumnGroupingsType _DataColumnGroupings;
        private GTame.ReportParser.DataRowGroupingsType _DataRowGroupings;
        private GTame.ReportParser.DataRowsType _DataRows;
        private string _DataSetName;
        private GTame.ReportParser.FiltersType _Filters;

        public GTame.ReportParser.DataColumnGroupingsType DataColumnGroupings
        {
            get
            {
                if (_DataColumnGroupings == null)
                    _DataColumnGroupings = new GTame.ReportParser.DataColumnGroupingsType();
                return _DataColumnGroupings;
            }
            set
            {
                _DataColumnGroupings = value;
            }
        }

        public GTame.ReportParser.DataRowGroupingsType DataRowGroupings
        {
            get
            {
                if (_DataRowGroupings == null)
                    _DataRowGroupings = new GTame.ReportParser.DataRowGroupingsType();
                return _DataRowGroupings;
            }
            set
            {
                _DataRowGroupings = value;
            }
        }

        public GTame.ReportParser.DataRowsType DataRows
        {
            get
            {
                if (_DataRows == null)
                    _DataRows = new GTame.ReportParser.DataRowsType();
                return _DataRows;
            }
            set
            {
                _DataRows = value;
            }
        }

        public string DataSetName
        {
            get
            {
                return _DataSetName;
            }
            set
            {
                _DataSetName = value;
            }
        }

        public GTame.ReportParser.FiltersType Filters
        {
            get
            {
                if (_Filters == null)
                    _Filters = new GTame.ReportParser.FiltersType();
                return _Filters;
            }
            set
            {
                _Filters = value;
            }
        }

        public CustomDataType()
        {
        }

        public Rdl.CustomDataType Write()
        {
            Rdl.CustomDataType customDataType = new Rdl.CustomDataType();
            System.Collections.ArrayList arrayList = new System.Collections.ArrayList();
            if (_DataColumnGroupings != null)
                arrayList.Add(_DataColumnGroupings.Write());
            if (_DataRowGroupings != null)
                arrayList.Add(_DataRowGroupings.Write());
            if (_DataRows != null)
                arrayList.Add(_DataRows.Write());
            if (_DataSetName != null)
                arrayList.Add(_DataSetName);
            if (_Filters != null)
                arrayList.Add(_Filters.Write());
            customDataType.Items = arrayList.ToArray();
            arrayList = null;
            return customDataType;
        }

    } // class CustomDataType

}

